_uact='<?php echo $_REQUEST['id_google']; ?>'; 
        urchinTracker();
        
        var z = _uGC(document.cookie, '__utmz=', ';');
			var source  = _uGC(z, 'utmcsr=', '|');
			var medium  = _uGC(z, 'utmcmd=', '|');
			var term    = _uGC(z, 'utmctr=', '|');
			var content = _uGC(z, 'utmcct=', '|');
			var campaign = _uGC(z, 'utmccn=', '|');
			var gclid   = _uGC(z, 'utmgclid=', '|');

			if (gclid !='-') {
      			source = 'google';
				medium = 'cpc';
			}
			var csegment = _uGC(document.cookie, '__utmv=', ';');
			if (csegment != '-') {
		      var csegmentex = /[1-9]*?\.(.*)/;
		      csegment    = csegment.match(csegmentex);
		      csegment    = csegment[1];
			} else {
		      csegment = '';
			}

			function populateHiddenFields(f) {
      			   $(f).find('#source').val(source);
                    $(f).find('#medium').val(medium);
                    $(f).find('#term').val(decodeURI(term));
                    $(f).find('#content').val(content);
                    $(f).find('#campaign').val(campaign);
                    $(f).find('#segment').val(csegment);
				return true;
			}

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-<?php echo $_REQUEST['id_google']; ?>']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
  
  // Add hidden fields to forms and populate them
$(document).ready(function(){
  $('.google-analytics-form').prepend('<!-- GOOGLE ANALITICs -->' +
	                   '<input type="hidden" id="source" name="source" value="source_test" />'+
	                   '<input type="hidden" id="medium" name="medium" value="medium_test" />'+
	                   '<input type="hidden" id="term" name="term" value="term_test" />'+
	                   '<input type="hidden" id="content" name="content" value="content_test" />'+
	                   '<input type="hidden" id="campaign" name="campaign" value="campaign_test" />'+
	                   '<input type="hidden" id="segment" name="segment" value="segment_test" />'+  
	                   '<!--END  GOOGLE ANALITICs -->');
    $('.google-analytics-form').each(function(){
        populateHiddenFields(this);
    });                           
});    
  